package com.CST.controller;

import com.CST.common.api.ResultObject;
import com.CST.dto.SysUserDeptCodeDTO;
import com.CST.service.IBdSysUserDeptCodeService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.log4j.Log4j2;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @BelongsProject: cbhs
 * @BelongsPackage: com.CST.controller
 * @Author: lp
 * @CreateTime: 2023-02-21  14:43
 * @Description: TODO
 * @Version: 1.0
 */
@Api(tags = {"科护士长数据权限"})
@RestController
@RequestMapping("/bdSysUserDeptCode")
@Log4j2
public class BdSysUserDeptCodeController {
@Autowired
private IBdSysUserDeptCodeService bdSysUserDeptCodeService;
    @ApiOperation("修改数据权限")
    @PostMapping("/updateSysUserDeptCode")
    public ResultObject updateSysUserDeptCode(@RequestBody SysUserDeptCodeDTO sysUserDeptCodeDTO){
        return ResultObject.successReturn(bdSysUserDeptCodeService.updateSysUserDeptCode(sysUserDeptCodeDTO));
    }
    @ApiOperation("用户id查询数据权限")
    @GetMapping("/getSysUserDeptCodeList")
    public ResultObject getSysUserDeptCodeList(@RequestParam String userId) {
        return ResultObject.successReturn(bdSysUserDeptCodeService.getSysUserDeptCodeList(userId));
    }

    @ApiOperation("获取数据权限")
    @GetMapping("/getDeptCodeVoList")
    public ResultObject getDeptCodeVoList() {
        return ResultObject.successReturn(bdSysUserDeptCodeService.getDeptCodeVoList());
    }


}
